package di

import (
	"fmt"
	"git.mycaigou.com/gfyx/micro-gfyx-bigdata-service/infrastructure/repository/bigdata/impl"
	impl2 "git.mycaigou.com/gfyx/micro-gfyx-bigdata-service/infrastructure/repository/common/impl"
	"git.myscrm.cn/golang/stark/v4"
	"gorm.io/gorm"
)

func (c *inject) InjectRepo() {
	errs := make([]error, 0)
	////注入db
	err := c.Provide(func() *gorm.DB {
		return stark.MySQLConn.GetClient()
	})
	errs = append(errs, err)

	//err := c.Provide(user.NewCommonUserDataRepository)
	//errs = append(errs, err)

	err = c.Provide(impl2.NewSrCommonRepo)
	errs = append(errs, err)

	err = c.Provide(impl.NewApiParamRepo)
	errs = append(errs, err)

	err = c.Provide(impl.NewApiRepo)
	errs = append(errs, err)

	fmt.Printf("InjectRepo errors:#%+v\n", errs)
}
